import request from '@/utils/request'

export function listTopic(query) {  //查询素材分页
    return request({
        url: '/business/topic/list',
        method: 'get',
        params: query
    })
}
//添加文章选题
export function addMytopic(data) {
    return request({
        url: '/business/topic',
        method: 'post',
        data: data
    })
}

//编辑选题
export function editMytopic(data) {
    return request({
        url: '/business/topic',
        method: 'put',
        data: data
    })
}

//删除文章选题
export function delMytopic(data) {
    return request({
        url: '/business/topic/' + data,
        method: 'delete',
       // data: data
    })
}

//删除初稿目录
export function delMytopicChuGao(data) {
    return request({
        url: '/business/article/' + data,
        method: 'delete',
       // data: data
    })
}


//选题页第二页
export function addTopic(data) {
    return request({
        url: '/business/article',
        method: 'post',
        data: data
    })
}
//选题页第二页修改回显
export function editTopic(topicId) {
    return request({
        url: `/business/article/getArticleInfoByTopicId/${topicId}`,
        method: 'get',
       // data: data
    })
}

//选题页第二页修改
export function editMyArtcile(data) {
    return request({
        url: '/business/article',
        method: 'put',
        data: data
    })
}

export function getSingleData(id) {  //回显选题
    return request({
        url: '/business/topic/' + id,
        method: 'get',
       // params: query
    })
}






